package com.action.gulimall.ware.service;

import com.action.common.to.SkuStockTo;
import com.action.common.to.mq.OrderTo;
import com.action.common.to.mq.StockLockedTo;
import com.action.gulimall.ware.vo.SkuHasStockVo;
import com.action.gulimall.ware.vo.WareSkuLockVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.action.common.utils.PageUtils;
import com.action.gulimall.ware.entity.WareSkuEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author shilun
 * @email shilun217@qq.com
 * @date 2021-06-09 23:17:11
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    public void addStock(Long skuId, Long wareId, Integer skuNum);

    List<SkuStockTo> skusHasStocks(List<Long> skuIds);

    List<SkuHasStockVo> getSkuHasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockVo lockVo);

    void unLockStock(StockLockedTo stockLockedTo) throws Exception;

    void unLockStock(OrderTo orderTo);

}

